//
//  DPUnitTest.m
//  DPUnitTest
//
//  Created by Ofri Wolfus on 06/10/06.
//  Copyright 2006 Ofri Wolfus. All rights reserved.
//

#import "DPUnitTest.h"

@implementation DPUnitTest

- (id)init {
	if ((self = [super init])) {
		_failReason = nil;
	}
	
	return self;
}

- (void)dealloc {
	[_failReason release]; _failReason = nil;
	[super dealloc];
}

- (BOOL)throwsForFaildTests {
	return YES;
}

- (BOOL)logsSuccessfulTests {
	return YES;
}

- (void)_DPThrow:(NSException *)e {
	[e raise];
}

- (void)setFailReason:(NSString *)format, ... {
	[_failReason release];
	
	if (format) {
		va_list va;
		
		va_start(va, format);
		_failReason = [[NSString alloc] initWithFormat:format arguments:va];
		va_end(va);
	} else {
		_failReason = nil;
	}
}

- (NSString *)failReason {
	return _failReason;
}

@end

@implementation DPSpeedTest

- (unsigned)numberOfIterations {
	return 10000U;
}

- (BOOL)verifiesAllTests {
	return NO;
}

- (BOOL)verifyResult:(id)result ofTest:(SEL)testName {
	return YES;
}

@end
